package cn.gok.hotelback.mapper;

import cn.gok.hotelback.entity.RoomNumber;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;

@Mapper
public interface RoomNumberMapper {
    @Select("SELECT * FROM room_numbers WHERE room_id = #{roomId}")
    RoomNumber selectById(@Param("roomId") Integer roomId);

    @Select("SELECT * FROM room_numbers WHERE room_type_id = #{roomTypeId} AND current_status = '0'")
    List<RoomNumber> selectFreeByType(@Param("roomTypeId") Integer roomTypeId);

    @Update("UPDATE room_numbers SET current_status = #{status} WHERE room_id = #{roomId}")
    int updateStatus(@Param("roomId") Integer roomId, @Param("status") String status);
} 